package de.rtbfaustball.sort;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import de.rtbfaustball.model.clubs.Club;

/**
 * Class provides methods to sort several kinds of lists.
 * 
 * @see http://www.rtbfaustball.de/pages/vereine-im-rtb
 * @author sebastian
 */
public class ListSorter {

	/**
	 * Sortes a list of Club objects alphabetically depending on the clubs city.
	 * 
	 * @param data
	 */
	public static final void sort(List<Club> data) {
		Collections.sort(data, new Comparator<Club>() {

			public int compare(Club x1, Club x2) {
				return x1.getCity().compareTo(x2.getCity());
			}
		});
	}
}
